package com.mhy.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhy.entity.enums.LayoutTypeEnum;
import com.mhy.entity.enums.ProjectStatusEnum;
import com.mhy.entity.po.ProjectPO;
import com.mhy.entity.vo.project.ProjectCreateVO;
import com.mhy.entity.vo.project.ProjectDescriptionVO;
import com.mhy.entity.vo.project.ProjectDetailVO;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.util.Date;

@ApiModel("项目VO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class ProjectDTO {
    private Integer projectId;
    private String name;
    private String description;
    private Integer userId;
    private String xml;
    private LayoutTypeEnum layoutStatus;
    private ProjectStatusEnum status;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date producetime;
    private String scenario;

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getXml() {
        return xml;
    }

    public void setXml(String xml) {
        this.xml = xml;
    }

    public LayoutTypeEnum getLayoutStatus() {
        return layoutStatus;
    }

    public void setLayoutStatus(LayoutTypeEnum layoutStatus) {
        this.layoutStatus = layoutStatus;
    }

    public ProjectStatusEnum getStatus() {
        return status;
    }

    public void setStatus(ProjectStatusEnum status) {
        this.status = status;
    }

    public Date getProducetime() {
        return producetime;
    }

    public void setProducetime(Date producetime) {
        this.producetime = producetime;
    }

    public String getScenario() {
        return scenario;
    }

    public void setScenario(String scenario) {
        this.scenario = scenario;
    }

    public ProjectDTO(ProjectPO projectPO) {
        BeanUtils.copyProperties(projectPO, this);
    }

    public ProjectDTO(ProjectDetailVO projectDetailVO) {
        BeanUtils.copyProperties(projectDetailVO, this);
    }

    public ProjectDTO(ProjectDescriptionVO projectDescriptionVO) {
        BeanUtils.copyProperties(projectDescriptionVO, this);
    }

    public ProjectDTO(ProjectCreateVO projectCreateVO) {
        BeanUtils.copyProperties(projectCreateVO, this);
    }

}
